package com.example.entity;


import org.springframework.beans.factory.annotation.Autowired;



// @Autowired注解 注入

public class Person2 {
    private String name;

    @Autowired // 位置一
    private Dog dog;
    
    private Cat cat;


    @Autowired // 位置二
    public void setCat(Cat cat) {
        this.cat = cat;
    }

    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public Dog getDog() {
        return dog;
    }
    public void setDog(Dog dog) {
        this.dog = dog;
    }
    public Cat getCat() {
        return cat;
    }    
    
}
